Hi Terence,
- I'm on the C++ development team, Please reply back to this forum:
Your code works fine...some poor person at "somebody@someplace.ca" is going to get this message
....
Question 1)
- What version of the toolkit are you using? I tried this on Windows 2000 running Notes 6.0.1 with the C++ API 2.3
Question 2)
- Is the environment setup correctly? i.e. location docs, etc. Can the user easily send out an email via the UI?
....
I used the following code
....
#include <windows.h>
#include <iostream.h>
#include <lncppapi.h>
const int ERR_BUF_SIZE=512+1;
char buffer[ERR_BUF_SIZE]="";
int main (int argc,char *argv[])
{
cout << "Testing "<<endl;
LNSetThrowAllErrors(TRUE);
LNNotesSession Session;
LNMailMessage mail;
LNItem bodyitem;
try
{
if(Session.Init())
MessageBox(NULL,"Unable to initialize session.","Error",MB_OK);
Session.CreateMailMessage(&mail);
mail.SetRecipients("steve_chin@us.ibm.com");
mail.SetDeliveryPriority(LNDELIVERYPRIORITY_NORMAL);
mail.SetMailImportance(LNMAILIMPORTANCE_NORMAL);
mail.SetDeliveryReport(LNDELIVERYREPORT_ON_FAILURE);
mail.SetSubject("Subject");
mail.SetCC("steve_chin@us.ibm.com");
LNRichText body;
if(mail.GetBody(&body))
MessageBox(NULL,"No body","ERROR",MB_OK);
else
body.SetValue("Hello This is successful.");
mail.Send();
//mail.Save();
}
catch (LNSTATUS status)
{
LNGetErrorMessage(status, buffer, ERR_BUF_SIZE);
cout <<buffer<<endl;
}
return 0;
}